import Router from 'koa-router';
import proxyService from '../../common/proxyService';
import {
  accountBase, // 基本信息
  accountView, // 账户概况
  accountConsume, // 订单及消费数据
  accountRevenue, // 收入数据
} from '../../api/agent';

const router = new Router();

router.post('/base', async ctx => {
  const response = await proxyService.postProxy(ctx, accountBase);
  return (ctx.body = response);
});

router.post('/view', async ctx => {
  const response = await proxyService.postProxy(ctx, accountView);
  return (ctx.body = response);
});

router.post('/consume', async ctx => {
  const response = await proxyService.postProxy(ctx, accountConsume);
  return (ctx.body = response);
});

router.post('/revenue', async ctx => {
  const response = await proxyService.postProxy(ctx, accountRevenue);
  return (ctx.body = response);
});

export default router;
